<%--
  ** Copyright(c) 2005 BroadVision, Inc. All rights reserved.
  **
  ** This software is copyrighted.  Under the copyright laws, this software
  ** may not be copied, in whole or in part, without prior written consent
  ** of BroadVision, Inc. or its assignees. This software is provided under
  ** the terms of a license between BroadVision and the recipient, and its
  ** use is subject to the terms of that license.
  **
  ** This software may be protected by one or more U.S. and International
  ** patents. Certain applications of BroadVision One-To-One software are
  ** covered by U.S. patent 5,710,887.
  **
  ** TRADEMARKS: BroadVision and the BroadVision logo are registered
  ** trademarks, and BroadVision One-To-One is a trademark of BroadVision,
  ** Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,
  ** MD5, and RC2 are trademarks of RSA Data Security, Inc. All other
  ** trademarks, service marks, and trade names belong to their respective
  ** owners. BroadVision, Inc. disclaims any proprietary interest in the
  ** marks and names of others.
  --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>

<%@ page import="com.broadvision.report.admin.LoggerConfig" %>
<%@ page import="com.broadvision.report.admin.FileLoggerConfig" %>

<%
  final LoggerConfig model =
          (LoggerConfig)request.getAttribute("loggerConfigModel");
  pageContext.setAttribute("logger", model);
%>
<c:set var="form" value="${reportLoggerForm.map}"/>

<html-el:javascript formName="reportLoggerForm"/>

<script language="Javascript">
  function doCancel(form)
  {
    form.action = '<c:url value="/bp/runtimeReportConfigLogger.do"/>';
    form.submit();
    return true;
  }
</script>

<html-el:form action="/bp/reportLoggerUpdate.do"
              onsubmit="return validateReportLoggerForm(this);">
<html-el:hidden name ="reportLoggerForm" property="name"/>
<html-el:hidden name ="reportLoggerForm" property="type"/>

<table class="zoneFive" summary="logger config"
       width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
        <bean-el:message
          key="bp.report.loggerEdit.title"
          bundle="bp.messages"
          arg0="${form.name}"
        />
      </div>
      <c:if test="${!empty reportConfigStatusKey}">
        <bean-el:message key="${reportConfigStatusKey}" bundle="bp.messages"/>
      </c:if>
      <div class="errorMessage"><html-el:errors bundle="bp.messages"/></div>

      <div class="pageSubtitle">
        <span class="left">
          <bean-el:message
            key="bp.report.loggerEdit.${form.type}.subtitle"
            bundle="bp.messages"/>
        </span>
        <span class="right">&nbsp;</span>
      </div>

      <div class="pageInstructions" align="left">
        <bean-el:message
          key="bp.report.loggerEdit.pageInstructions" bundle="bp.messages"
        />
      </div>

      <!--start main content area here-->
      <table class="labelForm"
             width="100%" border="0" cellspacing="0" cellpadding="0"
             summary="logger config info">
        <c:choose>
          <c:when test="${form.type == 'jdbc'}">
            <!-- JDBC logger -->
            <tr width="100%">
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerEdit.jdbc.label.resource"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <c:set
                  var="jdbcList"
                  value="${runtimeReportConfigModel.resourceList}"
                />
                <html-el:select property="jdbc" value="${logger.jdbc}">
                  <html-el:options
                    collection="jdbcList"
                    property="name"
                  />
                </html-el:select>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerEdit.jdbc.label.table"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="32" property="table"/>
              </td>
            </tr>
          </c:when>

          <c:when test="${form.type == 'file'}">
            <!-- file logger -->
            <tr width="100%">
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerEdit.file.label.path"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="44%" class="labelField">
                <html-el:text maxlength="128" size="64" property="path"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerEdit.file.label.schedule"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="24%" class="labelField">
                <%
                pageContext.setAttribute(
                                "scheduleList",
                                FileLoggerConfig.getScheduleChoices());
                %>
                <html-el:select property="schedule" value="${logger.schedule}">
                  <html-el:option value=""/>
                  <c:forEach var="schedule" items="${scheduleList}">
                    <html-el:option
                      bundle="bp.messages"
                      key="bp.report.logger.file.schedule.${schedule}"
                      value="${schedule}"
                    />
                  </c:forEach>
                </html-el:select>
              </td>
            </tr>
          </c:when>
        </c:choose>
      </table>
      <!--end main content area here-->

      <div class="pageButtonWrap" align="right">
        <html-el:reset styleClass="inputButton" property="resetBtn">
          <bean-el:message key="button.reset" bundle="bp.messages" />
        </html-el:reset>
        &nbsp;&nbsp;
        <html-el:button styleClass="inputButton" property="cancelBtn"
                        onclick="return doCancel(this.form);">
          <bean-el:message key="button.cancel" bundle="bp.messages"/>
        </html-el:button>
        <html-el:submit styleClass="inputButton" property="submitBtn">
          <bean-el:message key="button.update" bundle="bp.messages"/>
        </html-el:submit>
      </div>
    </td>
  </tr>
</table>

</html-el:form>

<!-- =============================================================
  ** vim: set ts=2 expandtab syntax=jsp:
  -->
